package com.example.zhujingmin.simpleplay;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class simplePlay extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_simple_play);
        Button button1=(Button)findViewById(R.id.start);
        button1.setOnClickListener(startIt);
        Button button2=(Button)findViewById(R.id.stop);
        button2.setOnClickListener(stopIt);
    }
    private View.OnClickListener startIt=new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            startService(new Intent("com.studio.android.START_AUDOI_SERVICE"));
        }
    };
    private View.OnClickListener stopIt=new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            stopService(new Intent("com.studio.android.START_AUDOI_SERVICE"));
        }
    };
}
